package com.jswlw.common.utils;

/**
 * @author 吴维斌 E-mail:wuweibin0817@163.com
 * @version 创建时间：${date} ${time}
 */
public class CountUtils {

    /**
     * 分销ID计算器,获取当前长度判断等级，下一级增加三位
     *
     * @param curr
     * @return
     */
    public static int toNext(int curr, int offset) {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(curr);
        String offsetStr = String.valueOf(offset);
        if (offsetStr.length() == 3) {
            stringBuffer.append(offsetStr);
        } else if (offsetStr.length() == 2) {
            stringBuffer.append("0").append(offsetStr);
        } else if (offsetStr.length() == 1) {
            stringBuffer.append("00").append(offsetStr);
        }
        return Integer.parseInt(stringBuffer.toString());
    }
}
